Function getSheetName(inx As Integer)
    
    If inx < 1 Then
        getSheetName = "illegal parameter"
        Exit Function
    End If
    
    Dim i, start_index, end_index As Integer
    
    start_index = 0
    end_index = 0
    
    Set wk_bk = ActiveWorkbook
    For i = 1 To wk_bk.Sheets.Count
        If wk_bk.Sheets(i).Name = "Start" Then
            start_index = i
        End If
        
        If wk_bk.Sheets(i).Name = "End" Then
            end_index = i
        End If
    Next i
    
    If start_index = 0 Or end_index = 0 Then
        getSheetName = "no Start_End"
        Exit Function
    End If
    
    If end_index - start_index < 0 Then
        getSheetName = "Start_End reversed"
        Exit Function
    End If
    
    If end_index - start_index <= 1 Then
        getSheetName = "no sheet in Start_End"
        Exit Function
    End If
    
    If inx + start_index >= end_index Then
        getSheetName = "out of Start_End"
        Exit Function
    End If
    
    getSheetName = wk_bk.Sheets(inx + start_index).Name

End Function
